package com.simple.util.math.function;

/**
 * @program: simple_tools
 * @description: 质因数分解函数
 * @author: ChenWenLong
 * @create: 2019-11-15 13:58
 **/
public class DecompositionPrimeFunction {

    public static void main(String[] args) {
        decompositionPrimeFunction(98);
    }

    public static void decompositionPrimeFunction(int n){
        System.err.print(n+"=");
        for (int j = 2; j <=n; j++) {
            while(n%j == 0){
                n/=j;
                System.err.print(j);
                if(n!=1){
                    System.err.print("*");
                }
            }
        }
    }
}
